package com.ls.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;

@Api(value = "IndexController",tags = "路由管理")
@Controller
public class IndexController {

    @ApiOperation(value = "跳转欢迎界面")
    @GetMapping("/")
    public String toWelcome(HttpSession session){
        session.setAttribute("title","后台首页");
        return "welcome";
    }

    @GetMapping("/accountList")
    public String toAccountList(HttpSession session){
        session.setAttribute("title","部门管理");
        return "user/accountList";
    }

    @ApiOperation(value = "跳转部门页面")
    @GetMapping("/department")
    public String toDepartment(HttpSession session){
        session.setAttribute("title","部门管理");
        return "department";
    }

    @ApiOperation(value = "跳转员工页面")
    @GetMapping("/employee")
    public String toStaff(HttpSession session){
        session.setAttribute("title","员工管理");
        return "employee";
    }

    @ApiOperation(value = "跳转职位页面")
    @GetMapping("/position")
    public String toPosition(HttpSession session){
        session.setAttribute("title","职位管理");
        return "position";
    }

    @ApiOperation(value = "个人信息页面")
    @GetMapping("/personal")
    public String toPersonal(HttpSession session){
        session.setAttribute("title","个人信息");
        return "user/personal";
    }
}
